package com.oocl.service.impl;

import com.oocl.exception.MyException;
import com.oocl.service.Service;



public abstract class ServiceFactory {
	
      public static ServiceFactory getServiceFactory(String factoryName) throws MyException{
    	  if(BookServiceFactory.BOOK.equals(factoryName)){
    		  return new BookServiceFactory();
    	  }else if(OrdersServiceFactory.ORDERS.equals(factoryName)){
    		  return new OrdersServiceFactory();
    	  }else if(PurchaserServiceFactory.PURCHASER.equals(factoryName)){
    		  return new PurchaserServiceFactory();
    	  }else{
    		  throw new MyException("can not factory '"+factoryName+"ServiceFactory'");
    	  }
      }
      
}
